package phoenix.workers.redmine;

import core.config.Config;
import phoenix.core.PhoenixManager;
import phoenix.core.base.TestSuiteBase;

public class GarbageCollector extends TestSuiteBase
{
	public static void main(String args[])
	{

		if (phoenix == null)
		{
			phoenix = new PhoenixManager();
			// Use Build
			Config.BUILD = "live";
		}

		if (phoenix.config().REDMINE_POST_ERRORS)
		{
			try
			{
				phoenix.db().connect(
						phoenix.config().DB_HOST,
						phoenix.config().DB_PORT,
						phoenix.config().DB_NAME,
						phoenix.config().DB_USER,
						phoenix.config().DB_PASSWORD);

				phoenix.db().isConnected();

				phoenix.redmine().garbageCollector();
				phoenix.log().info("GarbageCollector has been executed");

			}
			catch (Exception p_ex)
			{
				phoenix.log().error("Something went wrong in GarbageCollector " + p_ex.toString());
			}
		}
	}
}
